home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / MSG Graphic Effects 1.0 Source / Skipaline L-R.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-23  |  1.7 KB  |  47 lines  |  [TEXT/KAHL]

  1. /*******************************************************************************
  2.  * Copyright © 1992-1993 Mark Pilgrim                                          *
  3.  *                                                                             *
  4.  * This file is provided as is, and may be freely distributed unaltered.  This *
  5.  * message must accompany any copy of this file.  This file may be used or     *
  6.  * modified for use for a non-commercial product provided that appropriate     *
  7.  * credit is given to the author named above.                                  *
  8.  * Commercial use of this source code is prohibited.                           *
  9.  ******************************************************************************/
  10.  
  11. #include "msg misc.h"
  12. #include "msg timing.h"
  13.  
  14. #define CorrectTime 1
  15.  
  16. void SkipalineLR(GrafPtr);
  17.  
  18. /* Copy even-numbered columns starting at the left and moving right, and odd-
  19.    numbered columns starting at the right and moving left.  */
  20.    
  21. void SkipalineLR(GrafPtr sourceGrafPtr)
  22. {
  23.     Rect        thisone,thatone;
  24.     Boolean        everyOther=FALSE;
  25.     
  26.     thisone.left=thisone.top=thatone.top=0;
  27.     thisone.bottom=thatone.bottom=MAIN_WINDOW_HEIGHT;
  28.     thisone.right=1;
  29.     thatone.right=MAIN_WINDOW_WIDTH;
  30.     thatone.left=MAIN_WINDOW_WIDTH-1;
  31.         
  32.     while (thisone.left<MAIN_WINDOW_WIDTH)
  33.     {
  34.         StartTiming();
  35.         CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
  36.             &thisone, &thisone, 0, 0L);
  37.         CopyBits(&(sourceGrafPtr->portBits), &(gMainWindow->portBits),
  38.             &thatone, &thatone, 0, 0L);
  39.         thisone.left+=2;      /* left column moves right by 2 */
  40.         thisone.right+=2;
  41.         thatone.left-=2;      /* right column moves left by 2 */
  42.         thatone.right-=2;
  43.         if (everyOther)
  44.             TimeCorrection(CorrectTime);
  45.         everyOther=!everyOther;
  46.     }
  47. }